#include <iostream>
using namespace std;
int gcd(int n, int m)
{
    if (n<m)
    {
        n=m+n;
        m=n-m;
        n=n-m;
    }
    if (m==0) return n;
    return gcd(m,n%m);
}
int max_common_divisor(int several[], int n)
{
    int a=several[0];
    int b=several[1];
    int c=gcd(a,b);
    int i;
    for (i=2;i<n;i++)
    {
        c=gcd(c,several[i]);
    }
    return c;
}
int main()
{
    int aaa[1000];
	int in;
    cin>>in;
    int x,y;
    for(int data=0;data<in;data++)
	{
		cin>>aaa[data];
	}
    cout<<max_common_divisor(aaa,in);
    return 0;
}
